package start.spring.basic.demo.filter;

import java.io.IOException;

import javax.servlet.Filter;
import javax.servlet.FilterChain;
import javax.servlet.ServletException;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
import javax.servlet.annotation.WebFilter;

import org.springframework.stereotype.Component;

import lombok.extern.slf4j.Slf4j;

/**
 * ****************************************************************************
 * 权限过滤器，根据系统权限管理设计进行添加
 *
 * @author(作者)：xuyongyun	
 * @date(创建日期)：2023年2月4日
 ******************************************************************************
 */
@Slf4j
@Component
@WebFilter(filterName = "AuthFilter", urlPatterns = "/**")
public class AuthFilter implements Filter {

	@Override
	public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain)
			throws IOException, ServletException {
		log.info("进入权限过滤器！");
		chain.doFilter(request, response);
	}

	@Override
	public void destroy() {
		Filter.super.destroy();
	}
}
